package com.ccq.controller;

import com.alibaba.fastjson.JSON;
import com.ccq.model.Card;
import com.ccq.model.Second;
import com.ccq.service.SecondService;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping(value = { "front" })
public class SecondController {

    @Autowired
    SecondService secondService;

    @ApiOperation(value="选房卡",notes = "选房卡")
    @RequestMapping(value = { "card" },method = RequestMethod.POST)
    @ResponseBody
    public String card(){
        String  c=secondService.carddata();
        return c;
    }

    @ApiOperation(value="初始列表",notes = "初始列表")
    @RequestMapping(value = { "secondlist" },method = RequestMethod.POST)
    @ResponseBody
    public String secondlist(){
        String ls=secondService.deallist();
        return ls;
    }

    @ApiOperation(value="查询列表",notes = "查询列表")
    @RequestMapping(value = { "searchlist1" },method = RequestMethod.POST)
    @ResponseBody
    public String searchlist1(String adress,String price,String area,String shape,String times,String nice){
        System.out.println(adress+" "+price+" "+area+" "+shape+" "+times+" "+nice);
        String ls=secondService.searchlist1(adress,price,area,shape,times,nice);
        return ls;
    }
}
